home *** CD-ROM | disk | FTP | other *** search
- #define CONSOLE 1
- #define TEST 0
-
- /* パッドによる制御 */
-
- #include <cdrfrb.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <snd.h>
- #include "cdp.h"
-
- void whatkey();
- int a_old =0 ;
-
- void pad_sel()
- {
- int stat = 0;
- int a = 0;
- int key = 0;
-
- SND_joy_in_2( 0, &stat);
-
- a = ~stat; /* ビットの反転 */
- a &= 0xff; /* 下8桁のみ残して削る */
-
- if( a_old != a )
- {
- #if TEST
- printf("\n PAD status => 0x0%x\n", a);
- #endif
- switch( a ) {
- case 0x01: /* 上 */
- cdp_cont();
- break;
- case 0x02: /* 下 */
- cdp_p_c();
- break;
- case 0x04: /* 左 */
- cdp_back();
- break;
- case 0x08: /* 右 */
- cdp_next();
- break;
- case 0x10: /* ボタンA */
- cdp_first_go();
- break;
- case 0x20: /* ボタンB */
- cdp_stop();
- break;
- case 0x40: /* RUN */
- exit(0);
- case 0x80: /* SELECT */
- whatkey();
- }
- }
- a_old = a;
- }
-
-
- /* キーボード利用 */
-
- #include <fmcfrb.h>
-
- void whatkey()
- {
- unsigned int mus_num =0;
-
- #if CONSOLE
- printf(" 次の曲の番号を指定してください →");
- #endif
- scanf("%u",&mus_num );
- printf("mus_num = %d\n", mus_num);
- cdp_go( mus_num , 1 );
- }
-